/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tags;

/**
 *
 * @author admin
 */

import java.io.IOException;
import javax.servlet.ServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class GetRequestParametrTag extends TagSupport {
    
    private String property;
    
    public void setProperty(String property){
        this.property=property;
    }

    @Override
    public void setValue(String k, Object o) {
        super.setValue(k, o);
    }
    
    
    
    @Override
    public int doStartTag() throws JspException{
        ServletRequest reg = pageContext.getRequest();
        String value = reg.getParameter(property);
        
        try{
            pageContext.getOut().print(value==null?"000":value);
            
        }catch (java.io.IOException ex){
            throw new JspException(ex.getMessage());
        }
        return SKIP_BODY;
    }
    
     
}
